﻿<!DOCTYPE html>
<!--隐患排查管理-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/js/common.js"></script>
    <link href="../static/js/vue-treeselect/vue-treeselect.css" rel="stylesheet" />
    <script src="../static/js/vue-treeselect/vue-treeselect.js"></script>
    <style>
        .vue-treeselect__control {
            height: 100%;
            border: none;
            background: none;
        }

        .vue-treeselect__placeholder {
            top: -3px;
        }

        .vue-treeselect__single-value {
            top: -3px;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak class="popupW50">

        <el-form label-position="right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
            style="margin-bottom: 15px;">

            <el-row>
                <el-col class="head-tool">
                    <div class="new_title fl"><strong><img src="/static/images/icon1.png" />隐患排查管理列表</strong></div>

                    <span>
                        <btn :text="col.btnSelect" imgsrc="/static/images/search.png" linetype="3" @click="onSubmit">
                        </btn>
                        <btn text="新增排查" imgsrc="/static/images/add.png" linetype="4" @click="UserInput('tj')">
                        </btn>

                    </span>
                </el-col>
            </el-row>
            <el-row>
                <list-factorys-all v-model="formInline.model.CreateFactory" @change="factoryChange"></list-factorys-all>
                <el-col :xs="12" :sm="8" :md="8" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{RisksManagement.RiskTask.TimeS+mark.m}}
                                </template>
                                <!-- <el-date-picker v-model="formInline.model.DiscoveryTimeBegin" type="date" slot="suffix" -->
                                <el-date-picker v-model="formInline.model.BeginTime" type="date" slot="suffix" size="mini"
                                                placeholder="选择日期">
                                </el-date-picker>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :xs="12" :sm="8" :md="8" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{RisksManagement.RiskTask.TimeE+mark.m}}
                                </template>
                                <!-- <el-date-picker v-model="formInline.model.DiscoveryTimeEnd" type="date" slot="suffix" -->
                                <el-date-picker v-model="formInline.model.EndTime" type="date" slot="suffix" size="mini"
                                                placeholder="选择日期">
                                </el-date-picker>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>

                <el-col :xs="12" :sm="8" :md="8" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{RisksManagement.RiskTask.PersonInCharge+mark.m}}
                                </template>
                                <tree-department-staff-single slot="suffix" v-model="formInline.model.PersonInCharge" style="line-height:28px;"></tree-department-staff-single>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>

                <el-col :xs="12" :sm="8" :md="8" :lg="6" :xl="6">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{RisksManagement.RiskContent.Unit+mark.m}}
                                </template>
                                <treeselect v-model="formInline.model.Unit"
                                            :options="department"
                                            :flat="true"
                                            :show-count="true"
                                            slot="suffix"
                                            style="line-height: 28px;"
                                            placeholder="请选择" />
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>



            </el-row>
        </el-form>


        <el-col :span="24">
            <el-table stripe ref="table" :data="ListItem.tableData" :height="ListItem.tableHeight" border
                @selection-change="handleSelectionChange" row-style="height:10px" style="width: 100%">
                <!--:span-method="objectSpanMethod"-->
                <el-table-column type="selection" align="center" width="55">
                </el-table-column>

                <el-table-column type="index" :label="RisksManagement.RiskTask.id" :index="indexMethod" width="50"
                    show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="unitName" :label="RisksManagement.RiskTask.Unit" show-overflow-tooltip="true" align="center"> 
                </el-table-column>
                <el-table-column prop="objective" :label="RisksManagement.RiskTask.Objective" align="center"
                    show-overflow-tooltip="true">
                </el-table-column>
                <el-table-column prop="personInChargeText" width="90" show-overflow-tooltip="true" align="center"
                    :label="RisksManagement.RiskTask.PersonInCharge">
                </el-table-column>
                <el-table-column prop="participant" show-overflow-tooltip="true" width="90" align="center"
                    :label="RisksManagement.RiskTask.Participant">
                </el-table-column>
                <!-- <el-table-column prop="Items" :label="RisksManagement.RiskTask.Items" show-overflow-tooltip="true">
                </el-table-column>
                <el-table-column prop="ContainRegion" width="120" :label="RisksManagement.RiskTask.ContainRegion"
                    :formatter="getDicValue" show-overflow-tooltip="true">
                </el-table-column> -->
                <el-table-column prop="beginTime" :label="RisksManagement.RiskTask.TimeS" show-overflow-tooltip="true" align="center"
                    width="170">
                </el-table-column>
                <el-table-column prop="endTime" :label="RisksManagement.RiskTask.TimeE" show-overflow-tooltip="true" align="center"
                    width="170">
                </el-table-column>
                <el-table-column prop="status" :label="RisksManagement.RiskTask.status" show-overflow-tooltip="true" align="center"
                    width="90">
                </el-table-column>


                <el-table-column width="108" prop="update" :label="RisksManagement.RiskTask.Situation" fixed="right"  align="center">
                    <template slot-scope="scope">
                        <button type="button" class="elst-bt-xg" @click=UserInput('xg',scope.row.id)>
                            <i class="el-icon-search"></i>
                        </button>
                    </template>
                </el-table-column>
            </el-table>
            <el-row type="flex" justify="end">


                <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                    :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes" :page-size="ListItem.pagesize"
                    :layout="ListItem.layout" :total="ListItem.total">
                </el-pagination>

            </el-row>
        </el-col>
        <el-dialog title="排查详细情况" fullscreen="true" :visible.sync="ListItem.dialogVisible" @close='closeDialog'
            width="80%" height="80%" top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
        <!--:fullscreen="true"-->
    </div>
    <script type="text/javascript">
        Vue.component('treeselect', VueTreeselect.Treeselect)
        app = new Vue({
            el: '#app',
            data: function () {
                return {
                    defaultProps: {
                        children: 'children',
                        label: 'label'
                    },
                    //页面内数据初始化
                    ListItem: ListItem,
                    department: [],
                    formInline: {
                        model: {
                            PersonInCharge: null,
                            ContainRegion: null,
                            TimeS: '',
                            TimeE: '',
                        },
                        offset: 0,
                        limit: 10
                    },
                    PersonInCharge: [],
                    ContainRegion: []
                }
            },
            mounted: function () {
                //this.getDepartmentData();
                ////初始化数据
                //this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);

            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //表格序号连续化
                indexMethod: function (index) { return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1; },
                factoryChange: function () {
                    this.getDepartmentData();
                    this.GetPageData(1);
                },
                closeDialog: function () { closeDialog(this); },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //Dialog展示
                UserInput: function (val, id) { DialogShow(this, val, "RiskTaskInput.html", id); },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/YH_Screening/GetList') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); },
                //初始化部门下拉树
                getDepartmentData: function () {
                    var mythis = this;
                    myAjax("post", this, '/api/SysDepartment/GetList', { model: { Name: '', Code: '', CreateFactory: mythis.formInline.model.CreateFactory }, offset: 0, limit: 999 }, function (response) {
                        mythis.department = menuHelperX(response.data.pageData, guidEmpty)
                    }, false);
                },
            }
        });
        //下拉树数据格式化
        function menuHelperX(list, pid) {
            var result = [];
            if (list.length <= 0)
                return list;
            list.forEach(function (v, i) {
                var temp = {};
                for (var key in v) {
                    temp[key] = v[key];
                }
                temp.label = v.name;
                temp.parentId = temp.parentId ? temp.parentId : guidEmpty;
                var obj;
                if (temp.parentId == pid) {
                    obj = temp;
                    var nextObj = menuHelperX(list, temp.id);
                    if (nextObj.length > 0) {
                        obj.children = nextObj;
                    }
                }
                if (obj)
                    result.push(obj)
            })
            return result;
        }
    </script>
</body>

</html>